﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DetpartmentListCtrl.ascx.cs"
    Inherits="DMS.Web.Common.Controls.DetpartmentListCtrl" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="diy" %>
<asp:UpdatePanel ID="up_UserList" runat="server">
    <ContentTemplate>
        <%--搜索栏--%>
        <div id="dvSearch" runat="server" class="search">
            <!----------- 查询信息 ------------------>
            <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="ico">
                        <a href="javascript:changeView('2')">
                            <img src="/themes/default/ico_have.gif" id="ico_2" border="0"></a>
                    </td>
                    <td class="form">
                        <table cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                                <th>
                                    <nobr>
                                        部门名称：
                                    </nobr>
                                </th>
                                <td>
                                    <asp:TextBox ID="txtDeptName" runat="server" Width="80px"></asp:TextBox>
                                </td>
                                <th>
                                    <nobr>
                                        上级部门：
                                    </nobr>
                                </th>
                                <td>
                                    <nobr>
                                        <asp:TextBox ID="txtPDeptName" runat="server" Width="80px" ReadOnly="true" ToolTip="请在左侧组织架构中选择"></asp:TextBox>
                                        <input type="hidden" id="hidPDeptID" runat="server" />
                                        <input type="hidden" id="hidPDeptIDPath" runat="server" />
                                        <img id="imgSelectDept" runat="server" candisplay="NoDisplay" title="选择部门" src="/Resources/Images/icon_dept.gif"
                                            onclick="javascript:" />
                                    </nobr>
                                </td>
                                <td class="button">
                                    <nobr>
                                        <asp:LinkButton ID="btnQuery" CssClass="linkbtn" runat="server" OnClick="btnQuery_Click"><span>查询</span></asp:LinkButton>

                                    </nobr>
                                </td>
                            </tr>
                            <tbody id="div_2" style="display: none; border: 0px;">
                                <tr>
                                    <th>
                                        <span style="text-align: left;">
                                            <asp:CheckBox ID="cbDisplaySub" runat="server" CssClass="checker" Width="50px" Text="显示子部门："
                                                TextAlign="Left" Checked="false" />
                                        </span>
                                    </th>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <th>
                                        &nbsp;
                                    </th>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <th>
                                        &nbsp;
                                    </th>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <%--数据列表--%>
        <asp:DataGrid ID="dgDeptList" runat="server" AutoGenerateColumns="false" Width="100%"
            CssClass="dg_borderstyle" OnItemDataBound="dgDeptList_ItemDataBound">
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle CssClass="dg_itemstyle" />
            <AlternatingItemStyle CssClass="dg_alternatingitemstyle" />
            <Columns>
                <asp:TemplateColumn HeaderText="多选" Visible="false">
                    <ItemStyle Width="30px" HorizontalAlign="Center" />
                    <HeaderTemplate>
                        <a id="selectAllLink" href="javascript:" title="点击“全选”或“取消全选”" onclick="javascrpt:SelectAll(this, 'chkSelector');"
                            statue="false" style="cursor: hand;">全选</a>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input type="checkbox" id="chkSelector" name="chkSelector" value="<%#Eval("ID") %>"
                            onchange="javascript:return;UpdateChkStatue(this, 'selectAllLink');" />
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="单选" Visible="false">
                    <ItemStyle Width="30px" HorizontalAlign="Center" />
                    <HeaderTemplate>
                        选择
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input type="radio" id="radSelector" name="radSelector" value="<%#Eval("ID") %>"
                            onclick="javascript:Clear();AddItem('<%#Eval("Name") %>','<Actor Type=\'<%#Eval("ActorType") %>\' ID=\'<%#Eval("ID") %>\' Name=\'<%#Eval("Name") %>\' />');" />
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="部门名称">
                    <ItemStyle Width="300px" />
                    <ItemTemplate>
                        <div title="<%#Eval("Name") %>" style="overflow: hidden; text-overflow: ellipsis;
                            width: 300px;">
                            <nobr>
                                <%#Eval("Name") %>
                            </nobr>
                        </div>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="操作">
                    <ItemTemplate>
                        <nobr>
                            <img alt="角色设置" title="角色设置" src="/Resources/Images/icon_role.gif" onclick="javascript:OpenUserRoleSetting(this, '<%#Eval("ID") %>', 'User');"
                                style="cursor: hand;" />
                        </nobr>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="操作">
                    <ItemStyle HorizontalAlign="Center" />
                    <ItemTemplate>
                        <nobr>
                            <a id="lkSelectBtn" runat="server" href="javascript:">选择</a>
                        </nobr>
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
        </asp:DataGrid>
        <div id="dvPager" class="PagerHolder">
            <diy:AspNetPager ID="pager" runat="server" AlwaysShow="true" OnPageChanged="pager_PageChanged"
                Width="100%" ShowPageIndexBox="Always" PageIndexBoxType="TextBox" TextBeforePageIndexBox="转到"
                TextAfterPageIndexBox="页" ShowCustomInfoSection="Left" CustomInfoHTML="总数：%RecordCount%，共 %PageCount% 页，当前为第%CurrentPageIndex%页"
                HorizontalAlign="right" FirstPageText="首页" PrevPageText="上页" NextPageText="下页"
                LastPageText="末页" CssClass="dg_pagestyle">
            </diy:AspNetPager>
        </div>
        <div id="dvEmpty" runat="server" class="EmptyMsg" visible="false">
            没有查询到相应的部门信息。
        </div>
        <asp:ListBox ID="lbGridColState" runat="server" Visible="false">
            <asp:ListItem Value="SingleSelector">1</asp:ListItem>
            <asp:ListItem Value="Management">3</asp:ListItem>
            <asp:ListItem Value="MutilSelector">4</asp:ListItem>
        </asp:ListBox>
    </ContentTemplate>
</asp:UpdatePanel>
